package com.tofacebook.spring.model;

public class Emp {

    private Long empId;
    private String empName;
    private Integer age;
    private Character sex;

    public Emp() {
        System.out.println("ioc容器实例对象是调用的无参构造方法1");
    }

    public Emp(Long empId, String empName, Integer age, Character sex) {
        this.empId = empId;
        this.empName = empName;
        this.age = age;
        this.sex = sex;
    }

    public Long getEmpId() {
        return empId;
    }

    public void setEmpId(Long empId) {
        System.out.println("构造完对象之后，调用该方法往属性去赋值2");
        this.empId = empId;
    }

    public String getEmpName() {
        return empName;
    }

    public void setEmpName(String empName) {
        this.empName = empName;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Character getSex() {
        return sex;
    }

    public void setSex(Character sex) {
        this.sex = sex;
    }

    @Override
    public String toString() {
        return "Emp{" +
                "empId=" + empId +
                ", empName='" + empName + '\'' +
                ", age=" + age +
                ", sex=" + sex +
                '}';
    }
    //初始化方法之前之后还有一个方法，有我们bean后置处理器去处理

    /**
     * ioc容器构造对象的时候调用的初始化方法
     */
    public void inItMethod(){
        System.out.println("生命周期第三步3");
    }

    public void destoryMethod(){
        System.out.println("生命周期结束第三步5");
    }
}
